package cn.tanglong.quartz.service.impl;

import cn.tanglong.quartz.service.IQuartzService;
import cn.tanglong.quartz.util.QuartzUtil;
import org.quartz.Scheduler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class QuartzServiceImpl implements IQuartzService {

    @Autowired
    private Scheduler scheduler;

    // 添加定时任务
    @Override
    public void addOrderExpireJob(String JobName, Class cls, Object params, Date excuteTime) {
        // 容器 名字 工作得类 参数 执行得时间
        QuartzUtil.addJob(scheduler, JobName, cls, params, excuteTime);


    }
}
